package elcs.reply.model;

import java.util.List;

import javax.annotation.Resource;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;

import elcs.board.model.BoardVO;



@Repository
public class ReplyDaoImpl implements ReplyDao {
	@Resource(name="sqlSessionTemplate")
	private SqlSessionTemplate sqlSessionTemplate;

	@Override
	public void writeReply(ReplyVO rvo) throws Exception {
		this.sqlSessionTemplate.insert("reply.writeReply",rvo);
		
	}

	@Override
	public List<ReplyVO> replyList(BoardVO bvo) throws Exception {
		// TODO Auto-generated method stub
		return this.sqlSessionTemplate.selectList("reply.replyList",bvo);
	}

	@Override
	public void updateStep(ReplyVO rvo) throws Exception {
		this.sqlSessionTemplate.update("reply.updateStep",rvo);
		
	}

	@Override
	public void replyAnswerWrite(ReplyVO rvo) throws Exception {
		this.sqlSessionTemplate.insert("reply.replyAnswerWrite",rvo);
		
		
	}

	@Override
	public ReplyVO replyInfo(ReplyVO rvo) throws Exception {
		// TODO Auto-generated method stub
		return this.sqlSessionTemplate.selectOne("reply.replyInfo",rvo);
	}

	@Override
	public void deleteReply(ReplyVO rvo) throws Exception {
		this.sqlSessionTemplate.delete("reply.deleteReply",rvo);
		
		
	}

}
